package com.alex.mylibrary.tasks;

import android.os.AsyncTask;

/**
 * Created by
 * Author: alex
 * Email:
 * Date: 15-10-20.
 */

/**
 * 继承自异步任务，在UI中返回
 * @see TaskResult
 */
public abstract class BaseTask extends AsyncTask<String ,Void, TaskResult> {

    private TaskCallBack callBack;

    public BaseTask(TaskCallBack callBack) {
        this.callBack = callBack;
    }


    @Override
    protected void onPostExecute(TaskResult result) {
        super.onPostExecute(result);
        if (callBack != null) {
            callBack.onTaskFinished(result);
        }
    }
}
